//
// Created by Jisam on 2024/8/16 20:24.
// Solution of  C2
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <vector>

using namespace std;

#define endl "\n"
#define PSI pair<string,int>
#define PII pair<int,int>
#define PDI pair<double,int>
#define PDD pair<double,double>
#define VVI vector<vector<int>>
#define VI vector<int>
#define VS vector<string>

#define PQLI priority_queue<int, vector<int>, less<int>>
#define PQGI priority_queue<int, vector<int>, greater<int>>
#define ui unsigned
#define lli long long
#define ulli unsigned long long
#define code_by_jisam ios::sync_with_stdio(false),cin.tie(nullptr)
using namespace std;

const int N = 1e7+9;//10^7再平方的范围肯定是大于23333333333333

int primes[N], cnt;     // primes[]存储所有素数
bool st[N];         // st[x]存储x是否被筛掉

void get_primes(int n)
{
    for (int i = 2; i <= n; i ++ )
    {
        if (!st[i]) primes[cnt ++ ] = i;
        for (int j = 0; primes[j] <= n / i; j ++ )
        {
            st[primes[j] * i] = true;
            if (i % primes[j] == 0) break;
        }
    }
}
int main() {
    int n = 1e7+9; // 筛选小于等于100的素数
    get_primes(n);
//    for(auto x : primes) cout << x <<" ";
    lli ans = 0;
    for(lli i=0;i<cnt;i++){
        lli pp = primes[i]*primes[i];
        if(pp * pp >23333333333333) break;//一点小优化
        for(lli j=i+1;j<cnt;j++){
            lli qq = primes[j]*primes[j];
            if(pp*qq>23333333333333) break;
            if(pp*qq<2333) continue;
            ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}